Fix blocked a frame with origin#16887
Fix blocked a frame with origin#16887magento-engcom-team merged 3 commits intomagento:2.2-developfrom
Conversation
|
Hi @iGerchak. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
ihor-sviziev
left a comment
There was a problem hiding this comment.
As we discussed with @VladimirZaets in slack - probable root of the issue - using object by refference that could change during the validation and cause such issue, another thing - validation might be not really good. Lets try to improve validation or clone iframe element before validation just to have only one state during processing. But currently solution is not really good because it's hiding an actual issue.
|
@ihor-sviziev, I tried to make a clone of the object and work with it, but this solution does not fix the issue with the jQuery error in console. |
| elem.contentDocument || (elem.contentWindow ? elem.contentWindow.document : []) : | ||
| $.merge([], elem.childNodes); | ||
| } catch (e) { | ||
| return []; |
There was a problem hiding this comment.
Please add logging of this exception as "warning" using "Magento/Ui/view/base/web/js/lib/logger/console-logger.js"
|
Hi @iGerchak , I am closing this PR now due to inactivity. |
Add logging of exception
|
Hi @ihor-sviziev, thank you for the review. |
Add logging of exception
|
Hi @ihor-sviziev, thank you for the review. |
|
Hi @iGerchak. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Preconditions
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Steps to reproduce
Expected result
Console without errors
Actual result
Tech notes
Time to time created iframe on following line: https://github.com/magento/magento2/blob/2.2-develop/lib/web/jquery.js#L3123
Our change add try-catch to this method, and when error appears - we just returning an empty array.